package com.moss.cloud.common.sms.exception;

import lombok.Getter;

/**
 * 文件上传异常
 *
 * @author 瑾年
 * @date 2019/4/3 16:35
 */
@Getter
public class SmsException extends RuntimeException {
    /**
     * 异常对应的错误类型
     */
    private final ErrorType errorType;

    /**
     * 默认是文件上传异常
     */
    public SmsException() {
        this.errorType = SmsErrorType.STORAGE_ERROR;
    }

    public SmsException(ErrorType errorType) {
        this.errorType = errorType;
    }

    public SmsException(ErrorType errorType, String message) {
        super(message);
        this.errorType = errorType;
    }

    public SmsException(ErrorType errorType, String message, Throwable cause) {
        super(message, cause);
        this.errorType = errorType;
    }
}
